// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	12/29/2013 8:57:55 PM				
// -----------------------------

#ifndef _Vector3_h
#define _Vector3_h

#include "Defines.h"

struct Vector2;
struct Vector4;

struct Vector3
{

	/* Constants */
	static const Vector3	Zero;
	static const Vector3	One;
	static const Vector3	UnitX;
	static const Vector3	UnitY;
	static const Vector3	UnitZ;

	/* Datamembers */
	Float	x;
	Float	y;
	Float	z;

	/* Constructors */
	Vector3();
	Vector3(Float X, Float Y, Float Z);

	Vector3(const Vector3& refVector);
	Vector3(const Vector4& refVector);
	Vector3(const Vector2& refVector, Float Z);

	Vector3& operator=(const Vector3& refVector);

	/* Comparison Operators */
	Bool operator==(const Vector3& refVector) const;
	Bool operator!=(const Vector3& refVector) const;
	Bool operator<(const Vector3& refVector) const;
	Bool operator>(const Vector3& refVector) const;
	Bool operator<=(const Vector3& refVector) const;
	Bool operator>=(const Vector3& refVector) const;

	/* Mathematical In-Place operators */
	Vector3& operator+=(const Vector3& refVector);
	Vector3& operator-=(const Vector3& refVector);
	Vector3& operator*=(Float fScalar);
	Vector3& operator/=(Float fScalar);

	/* Mathematical Out-Of-Place Operators */
	Vector3 operator+(const Vector3& refVector) const;
	Vector3 operator-(const Vector3& refVector) const;
	Vector3 operator-() const;
	Vector3 operator*(Float fScalar) const;
	Vector3 operator/(Float fScalar) const;

	/* Mathematical Friend Operators */
	friend Vector3 operator*(Float fScalar, const Vector3& refVector);

	/* Methods */
	Float		Length() const;
	Vector3		Normalized() const;
	Vector3		CrossProduct(const Vector3& refVector) const;
	Float		DotProduct(const Vector3& refVector) const;
	void		AsArray(Float arr[3]) const;
	Vector3		Lerp(const Vector3& other, Float alpha) const;

};

#endif